{"ast":null,"code":"import _defineProperty from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport React, { useRef, memo, useContext, useEffect, useCallback, useMemo } from 'react';\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport FileTextOutlined from \"@ant-design/icons/es/icons/FileTextOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport FloatButton, { floatButtonPrefixCls } from './FloatButton';\nimport { ConfigContext } from '../config-provider';\nimport { FloatButtonGroupProvider } from './context';\nimport useStyle from './style';\nvar FloatButtonGroup = function FloatButtonGroup(props) {\n  var _classNames;\n  var customizePrefixCls = props.prefixCls,\n    className = props.className,\n    style = props.style,\n    _props$shape = props.shape,\n    shape = _props$shape === void 0 ? 'circle' : _props$shape,\n    _props$type = props.type,\n    type = _props$type === void 0 ? 'default' : _props$type,\n    _props$icon = props.icon,\n    icon = _props$icon === void 0 ? /*#__PURE__*/React.createElement(FileTextOutlined, null) : _props$icon,\n    _props$closeIcon = props.closeIcon,\n    closeIcon = _props$closeIcon === void 0 ? /*#__PURE__*/React.createElement(CloseOutlined, null) : _props$closeIcon,\n    description = props.description,\n    trigger = props.trigger,\n    children = props.children,\n    onOpenChange = props.onOpenChange;\n  var _useContext = useContext(ConfigContext),\n    direction = _useContext.direction,\n    getPrefixCls = _useContext.getPrefixCls;\n  var prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);\n  var _useStyle = useStyle(prefixCls),\n    _useStyle2 = _slicedToArray(_useStyle, 2),\n    wrapSSR = _useStyle2[0],\n    hashId = _useStyle2[1];\n  var groupPrefixCls = \"\".concat(prefixCls, \"-group\");\n  var groupCls = classNames(groupPrefixCls, hashId, className, (_classNames = {}, _defineProperty(_classNames, \"\".concat(groupPrefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(groupPrefixCls, \"-\").concat(shape), shape), _defineProperty(_classNames, \"\".concat(groupPrefixCls, \"-\").concat(shape, \"-shadow\"), !trigger), _classNames));\n  var wrapperCls = classNames(hashId, \"\".concat(groupPrefixCls, \"-wrap\"));\n  var _useMergedState = useMergedState(false, {\n      value: props.open\n    }),\n    _useMergedState2 = _slicedToArray(_useMergedState, 2),\n    open = _useMergedState2[0],\n    setOpen = _useMergedState2[1];\n  var floatButtonGroupRef = useRef(null);\n  var floatButtonRef = useRef(null);\n  var hoverAction = useMemo(function () {\n    var hoverTypeAction = {\n      onMouseEnter: function onMouseEnter() {\n        setOpen(true);\n        onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(true);\n      },\n      onMouseLeave: function onMouseLeave() {\n        setOpen(false);\n        onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);\n      }\n    };\n    return trigger === 'hover' ? hoverTypeAction : {};\n  }, [trigger]);\n  var handleOpenChange = function handleOpenChange() {\n    setOpen(function (prevState) {\n      onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(!prevState);\n      return !prevState;\n    });\n  };\n  var onClick = useCallback(function (e) {\n    var _a, _b;\n    if ((_a = floatButtonGroupRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {\n      if ((_b = floatButtonRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target)) {\n        handleOpenChange();\n      }\n      return;\n    }\n    setOpen(false);\n    onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);\n  }, [trigger]);\n  useEffect(function () {\n    if (trigger === 'click') {\n      document.addEventListener('click', onClick);\n      return function () {\n        document.removeEventListener('click', onClick);\n      };\n    }\n  }, [trigger]);\n  return wrapSSR( /*#__PURE__*/React.createElement(FloatButtonGroupProvider, {\n    value: shape\n  }, /*#__PURE__*/React.createElement(\"div\", Object.assign({\n    ref: floatButtonGroupRef,\n    className: groupCls,\n    style: style\n  }, hoverAction), trigger && ['click', 'hover'].includes(trigger) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CSSMotion, {\n    visible: open,\n    motionName: \"\".concat(groupPrefixCls, \"-wrap\")\n  }, function (_ref) {\n    var motionClassName = _ref.className;\n    return /*#__PURE__*/React.createElement(\"div\", {\n      className: classNames(motionClassName, wrapperCls)\n    }, children);\n  }), /*#__PURE__*/React.createElement(FloatButton, {\n    ref: floatButtonRef,\n    type: type,\n    shape: shape,\n    icon: open ? closeIcon : icon,\n    description: description\n  })) : children)));\n};\nexport default /*#__PURE__*/memo(FloatButtonGroup);","map":{"version":3,"names":["React","useRef","memo","useContext","useEffect","useCallback","useMemo","CloseOutlined","FileTextOutlined","classNames","CSSMotion","useMergedState","FloatButton","floatButtonPrefixCls","ConfigContext","FloatButtonGroupProvider","useStyle","FloatButtonGroup","props","customizePrefixCls","prefixCls","className","style","shape","type","icon","createElement","closeIcon","description","trigger","children","onOpenChange","direction","getPrefixCls","wrapSSR","hashId","groupPrefixCls","groupCls","wrapperCls","value","open","setOpen","floatButtonGroupRef","floatButtonRef","hoverAction","hoverTypeAction","onMouseEnter","onMouseLeave","handleOpenChange","prevState","onClick","e","_a","_b","current","contains","target","document","addEventListener","removeEventListener","Object","assign","ref","includes","Fragment","visible","motionName","_ref","motionClassName"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/float-button/FloatButtonGroup.js"],"sourcesContent":["import React, { useRef, memo, useContext, useEffect, useCallback, useMemo } from 'react';\nimport CloseOutlined from \"@ant-design/icons/es/icons/CloseOutlined\";\nimport FileTextOutlined from \"@ant-design/icons/es/icons/FileTextOutlined\";\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport FloatButton, { floatButtonPrefixCls } from './FloatButton';\nimport { ConfigContext } from '../config-provider';\nimport { FloatButtonGroupProvider } from './context';\nimport useStyle from './style';\nconst FloatButtonGroup = props => {\n  const {\n    prefixCls: customizePrefixCls,\n    className,\n    style,\n    shape = 'circle',\n    type = 'default',\n    icon = /*#__PURE__*/React.createElement(FileTextOutlined, null),\n    closeIcon = /*#__PURE__*/React.createElement(CloseOutlined, null),\n    description,\n    trigger,\n    children,\n    onOpenChange\n  } = props;\n  const {\n    direction,\n    getPrefixCls\n  } = useContext(ConfigContext);\n  const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const groupPrefixCls = `${prefixCls}-group`;\n  const groupCls = classNames(groupPrefixCls, hashId, className, {\n    [`${groupPrefixCls}-rtl`]: direction === 'rtl',\n    [`${groupPrefixCls}-${shape}`]: shape,\n    [`${groupPrefixCls}-${shape}-shadow`]: !trigger\n  });\n  const wrapperCls = classNames(hashId, `${groupPrefixCls}-wrap`);\n  const [open, setOpen] = useMergedState(false, {\n    value: props.open\n  });\n  const floatButtonGroupRef = useRef(null);\n  const floatButtonRef = useRef(null);\n  const hoverAction = useMemo(() => {\n    const hoverTypeAction = {\n      onMouseEnter() {\n        setOpen(true);\n        onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(true);\n      },\n      onMouseLeave() {\n        setOpen(false);\n        onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);\n      }\n    };\n    return trigger === 'hover' ? hoverTypeAction : {};\n  }, [trigger]);\n  const handleOpenChange = () => {\n    setOpen(prevState => {\n      onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(!prevState);\n      return !prevState;\n    });\n  };\n  const onClick = useCallback(e => {\n    var _a, _b;\n    if ((_a = floatButtonGroupRef.current) === null || _a === void 0 ? void 0 : _a.contains(e.target)) {\n      if ((_b = floatButtonRef.current) === null || _b === void 0 ? void 0 : _b.contains(e.target)) {\n        handleOpenChange();\n      }\n      return;\n    }\n    setOpen(false);\n    onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);\n  }, [trigger]);\n  useEffect(() => {\n    if (trigger === 'click') {\n      document.addEventListener('click', onClick);\n      return () => {\n        document.removeEventListener('click', onClick);\n      };\n    }\n  }, [trigger]);\n  return wrapSSR( /*#__PURE__*/React.createElement(FloatButtonGroupProvider, {\n    value: shape\n  }, /*#__PURE__*/React.createElement(\"div\", Object.assign({\n    ref: floatButtonGroupRef,\n    className: groupCls,\n    style: style\n  }, hoverAction), trigger && ['click', 'hover'].includes(trigger) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CSSMotion, {\n    visible: open,\n    motionName: `${groupPrefixCls}-wrap`\n  }, _ref => {\n    let {\n      className: motionClassName\n    } = _ref;\n    return /*#__PURE__*/React.createElement(\"div\", {\n      className: classNames(motionClassName, wrapperCls)\n    }, children);\n  }), /*#__PURE__*/React.createElement(FloatButton, {\n    ref: floatButtonRef,\n    type: type,\n    shape: shape,\n    icon: open ? closeIcon : icon,\n    description: description\n  })) : children)));\n};\nexport default /*#__PURE__*/memo(FloatButtonGroup);"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,EAAEC,IAAI,EAAEC,UAAU,EAAEC,SAAS,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACxF,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,gBAAgB,MAAM,6CAA6C;AAC1E,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,WAAW;AACjC,OAAOC,cAAc,MAAM,iCAAiC;AAC5D,OAAOC,WAAW,IAAIC,oBAAoB,QAAQ,eAAe;AACjE,SAASC,aAAa,QAAQ,oBAAoB;AAClD,SAASC,wBAAwB,QAAQ,WAAW;AACpD,OAAOC,QAAQ,MAAM,SAAS;AAC9B,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgB,CAAGC,KAAK,EAAI;EAAA;EAChC,IACaC,kBAAkB,GAW3BD,KAAK,CAXPE,SAAS;IACTC,SAAS,GAUPH,KAAK,CA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